﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using EzDesk.Apps.Model.ProjectModule;
using System.Threading;

namespace EzDesk.Clients.DesktopWeb.Controllers
{
    public class TestController : Controller
    {
        //
        // GET: /Test/

        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Gantt()
        {
            return View();
        }

        public ActionResult EzFormDialog()
        {
            return View();
        }

        public ActionResult QTip()
        {
            return View();
        }

        public ActionResult UserSelector()
        {
            return View();
        }

        public ActionResult ContextPanel()
        {
            return View();
        }

        public ActionResult WrapTipBox()
        {
            return View();
        }

        public ActionResult ClickToEditBox()
        {
            return View();
        }

        public ActionResult DisplaySnapStatusInfo()
        {
            return View();
        }

        public ActionResult AjaxBusy()
        {
            return View();
        }

        public JsonResult MockRequest(int timespan)
        {
            Thread.Sleep(timespan);
            return Json(new object(), JsonRequestBehavior.AllowGet);
        }

        public ActionResult dialog()
        {
            return View();
        }

        public ActionResult jQueryTemplate()
        {
            return View();
        }

        public ActionResult GetQueryString()
        {
            return View();
        }

        public ActionResult Highlight()
        {
            return View();
        }

        public ActionResult Tips()
        {
            return View();
        }

        public ActionResult LoopReference()
        {

            var model = new A() { Name = "女" };
            model.Husband = new B() { Name = "男" };
            model.Husband.Wife = new List<A>();
            model.Husband.Wife.Add(model);
            model.Husband.Wife.Add(new A(){Name = "女2", Husband = model.Husband});
            return View(model.Husband);
        }
        class A
        {
            public B Husband { get; set; }
            public string Name { get; set; }
        }
        class B
        {
            public List<A> Wife { get; set; }
            public string Name { get; set; }
        }
    }
}
